package com.lemon.exam.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 试题类型 枚举对象
 *
 * @author Lemon
 * @since 2025/7/22 15:11
 */
@Getter
@AllArgsConstructor
public enum QuestionTypeEnum {
    SINGLE_CHOICE("单选题"),
    MULTIPLE_CHOICE("多选题"),
    JUDGMENT("判断题"),
    FILL_IN_THE_BLANK("填空题"),
    QUESTION_ANSWER("问答题");

    private final String type;

    public static QuestionTypeEnum fromType(String type) {
        return Arrays.stream(values())
                .filter(e -> e.getType().equals(type))
                .findFirst()
                .orElse(null);
    }
}
